#ifndef _WINDOWCANMORE_H_
#define _WINDOWCANMORE_H_
#include <assert.h>
#include <stdio.h>

class WindowCanmore: public WindowInterface
{
public:
  ~WindowCanmore();

  bool open(Context* eglContext, InputListener* listener, const char title[], int width, int height );
  void close();

  // show the window (it is initially hidden)

  void show();

  // hide the window

  void hide();

  // check if window is visible?

  bool visible() const;

  // put window in fullscreen mode

  void fullscreen(int width, int height);
  // put window in windowed mode

  void windowed( int width, int height );


  // center the window on the desktop
  // note: has no effect if the window is minimized or maximized

  void center();

  // zoom window

  void zoom( float scale );

  bool isRun() const;

  // window update pumps the message queue

  void update();

  // get the window handle.
  // null if the window failed to initialize.

  WindowHandle handle() const;

  int getWidth() const;
  int getHeight() const;
  bool getActive() const;

  Mode getOutputMode() const;

  // title management

  void title( const char title[] );

  // listener management
  InputListener * listener() const;
protected:
  void ProcessEventAll();
  void ProcessUnEventAll();

private:
  WindowHandle window;					// window handle
  int width;						// natural window width
  int height;						// natural window height
  bool active;					// true if window is currently active
  bool run;

  Mode mode;						// current window mode (fullscreen or windowed)

  bool centered;					// true if window is centered

  Context * eglContext;		// the eglContext interface (must not be null)
  InputListener * _listener;			// the listener interface (may be null)
};

typedef WindowCanmore WindowClass;

#endif // _WINDOWCANMORE_H_
